package 反射;

public class 反射_2_继承父类和接口 {

    public static void main(String[] args) {
        try {
            Class c1 = Class.forName("反射.反射_2_父类");

            Class superClass  = c1.getSuperclass();//获取父类
            System.out.println(superClass.getName());


            Class[] c2 = c1.getInterfaces();//获取接口 必须传入一个列表

            for (Class c2_1 : c2){
                System.out.println(c2_1.getName());
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
